﻿#include "StepJumpDialog.h"
#include <QMenu>
#include <QMessageBox>
#include <QFileDialog>
#include "DataTrans.h"
#include "StepEditDialog.h"

//
StepJumpDialog::StepJumpDialog(QWidget *parent)
	: QDialog(parent)
{
	ui.setupUi(this);		

	m_tableHelper.init(ui.tableWidget);
	select = 0;	
}

StepJumpDialog::~StepJumpDialog()
{
}

void StepJumpDialog::showEvent(QShowEvent *event)
{
	updateTable();
	__super::showEvent(event);
}

void StepJumpDialog::updateTable()
{
	m_tableHelper.updateTable(stepInfo);
	ui.tableWidget->setCurrentItem(ui.tableWidget->item(0, 0));
}

void StepJumpDialog::on_btnOk_clicked()
{
	select = ui.tableWidget->currentRow();
	accept();
}

void StepJumpDialog::on_btnCancel_clicked()
{
	reject();
}